package com.jinke.uang.bean;

import com.jinke.uang.utils.StringUtils;

import java.io.Serializable;
import java.util.List;

public class PayCodeData implements Serializable {
    private static final long serialVersionUID = -756324453307072618L;

    /**
     * timeSeconds : 21600
     * payCode : [{"permataCode":"8359180605338963"},{"bniCode":""},{"otcCode":"8888859300703407"}]
     */

    private int timeSeconds;
    private List<PayCodeBean> payCode;

    public PayCodeBean getPayCodeBean() {
        if (mPayCodeBean == null) {
            if (payCode == null || payCode.size() == 0) {
                return null;
            }
            mPayCodeBean = new PayCodeBean();
            for (int i = 0; i < payCode.size(); i++) {
                PayCodeBean payCodeBean = payCode.get(i);
                if (payCodeBean == null) continue;
                if (!StringUtils.isEmpty(payCodeBean.getBniCode())) {
                    mPayCodeBean.setBniCode(payCodeBean.getBniCode());
                }

                if (!StringUtils.isEmpty(payCodeBean.getOtcCode())) {
                    mPayCodeBean.setOtcCode(payCodeBean.getOtcCode());
                }

                if (!StringUtils.isEmpty(payCodeBean.getPermataCode())) {
                    mPayCodeBean.setPermataCode(payCodeBean.getPermataCode());
                }
            }
        }
        return mPayCodeBean;
    }

    private PayCodeBean mPayCodeBean;

    public int getTimeSeconds() {
        return timeSeconds;
    }

    public void setTimeSeconds(int timeSeconds) {
        this.timeSeconds = timeSeconds;
    }

    public List<PayCodeBean> getPayCode() {
        return payCode;
    }

    public void setPayCode(List<PayCodeBean> payCode) {
        this.payCode = payCode;
    }


    public static class PayCodeBean implements Serializable {
        private static final long serialVersionUID = 2155955367801251379L;
        /**
         * permataCode : 8359180605338963
         * bniCode :
         * otcCode : 8888859300703407
         */

        private String permataCode;
        private String bniCode;
        private String otcCode;

        public String getPermataCode() {
            return permataCode;
        }

        public void setPermataCode(String permataCode) {
            this.permataCode = permataCode;
        }

        public String getBniCode() {
            return bniCode;
        }

        public void setBniCode(String bniCode) {
            this.bniCode = bniCode;
        }

        public String getOtcCode() {
            return otcCode;
        }

        public void setOtcCode(String otcCode) {
            this.otcCode = otcCode;
        }
    }
}
